runOnStartup(async runtime => {
    runtime.getLayout("森林-测试场景").addEventListener("beforelayoutstart", () => doinit())

    runtime.addEventListener("tick", () => tick());

});

export function doinit() {

    start_box_Event.INIT()
}


export function tick() {
    start_box_Event.tick()

}

class start_box_Event {


    static INIT() {

        /**@type {ISpriteFontInstance} */
        this.playerInstance = runtime.objects.Player.getFirstInstance()
        /**@type {I3DShapeInstance} */
        this.Box = runtime.objects.Elevatorplatform.getFirstInstance()
        /** @type {Ibe} */
        this.boxOpen = false
        if (this.Box.zHeight == 5) {
            this.boxOpen = true
        } else {
            this.boxOpen = false
        }



    }

    static tick() {



        this.HandleOpenBox()


    }



    static HandleOpenBox() {



        for (let thisTalkMask of runtime.objects.f_TalkMask.instances()) {
            if (thisTalkMask.instVars.bindUId === 50) {
                if (this.playerInstance.testOverlap(thisTalkMask)) {
                    if (runtime.keyboard.isKeyDown("KeyE")) {

                        if (!this.boxOpen) {
                            this.Box.zHeight = 5
                            this.boxOpen = true
                        }

                        if (this.boxOpen) {

                        }


                    }
                }

            }
        }
    }

}
export default start_box_Event;



